﻿using Basic.OAGatewayModule.Interface;
using Basic.OAGatewayModule.Model.UserFill;
using WeDonekRpc.Client;
using WeDonekRpc.Helper.Validate;
using WeDonekRpc.HttpApiGateway;
using WeDonekRpc.HttpApiGateway.Model;

namespace Basic.OAGatewayModule.Api
{
    internal class UserFillApi : ApiController
    {
        private readonly IUserFillService _Service;
        public UserFillApi ( IUserFillService service )
        {
            this._Service = service;
        }
        public UserFillDto Get ( [NumValidate("oa.fill.item.id.error", 1)] long id )
        {
            return this._Service.Get(id);
        }
        public PagingResult<UserFillItemDto> Query ( PagingParam<UserFillQuery> param )
        {
            return this._Service.Query(param, base.UserState.ToEmpId());
        }
        public bool Revoke ( [NumValidate("oa.fill.item.id.error", 1)] long id )
        {
            return this._Service.Revoke(id, base.UserState.ToEmpId());
        }
        public bool Submit ( [NumValidate("oa.fill.item.id.error", 1)] long id )
        {
            return this._Service.Submit(id, base.UserState.ToEmpId());
        }
    }
}
